<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

<script type="text/javascript">
var lockOpts = {
    msg : "<bean:message key="user.lock.msg" bundle="errors"/>",
    boxTitle : "<bean:message key="user.lock.boxTitle" bundle="errors"/>",
    msgStatus: "<bean:message key="user.lock.msgStatus" bundle="errors"/>"
};

var unlockOpts = {
    msg : "<bean:message key="user.unlock.msg" bundle="errors"/>",
    boxTitle : "<bean:message key="user.unlock.boxTitle" bundle="errors"/>",
    msgStatus: "<bean:message key="user.unlock.msgStatus" bundle="errors"/>"
};
</script>

<c:forEach items="${requestScope.users}" var="item">
	<div class="result">
	<ul id="itemResult-${item.userID}" class="itemResultNW <c:if test="${not item.enabled}">userDisabled</c:if>">
		<li>
			<p class="UFname">${item.profile.firstName}</p>
		</li>
		<li>
			<p class="UName">${item.profile.lastName}</p>
		</li>
		<li>
		    <p class="UNick">${item.username}</p>
		</li>
		<li>
			<p class="URole">
		      <c:forEach items="${item.roles}" var="role">
		          <p>${role.description}</p>
		      </c:forEach>
		    </p>
		</li>
		<li>
			<p class="UOffice">${item.office.number}</p>
		</li>
		<li>
			<p class="UEMail"><a href="mailto:${item.email}">${item.email}</a></p>
		</li>
		<li>
			<p class="UPhone">${item.profile.phone}</p>
		</li>
		<li class="panelUser" id="panelUser-${item.userID}">
  	        <p class="userBlock <c:if test="${not item.enabled}">hidden</c:if>" id="userLock-${item.userID}"> 
	         <a class="aUserBlock" href="javascript:lockUser('${item.userID}','${pageContext.request.contextPath}/admin/lockunlockuser.do');">
		      <img class="imgPanelUH" src="<c:url value="/layout/images/form/Block.png"/>" alt="<bean:message key="user.lock" bundle="profile"/>" title="<bean:message key="user.lock" bundle="profile"/>" />
		     </a>
		    </p>
		    <p class="userUnlock <c:if test="${item.enabled}">hidden</c:if>" id="userUnlock-${item.userID}">
		     <a class="aUserUnlock" href="javascript:unlockUser('${item.userID}','${pageContext.request.contextPath}/admin/lockunlockuser.do');">
		      <img class="imgPanelUH" src="<c:url value="/layout/images/form/Unlock.png"/>" alt="<bean:message key="user.unlock" bundle="profile"/>" title="<bean:message key="user.unlock" bundle="profile"/>" />
		     </a>
		    </p>
			<p class="userEdit">
			 <a class="aUserEdit" href="${pageContext.request.contextPath}/admin/activeedituser.do?userID=${item.userID}">
			     <img class="imgPanelOffice" src="<c:url value="/layout/images/form/Edit2.png"/>" alt="<bean:message key="user.edit" bundle="profile"/>" title="<bean:message key="user.edit" bundle="profile"/>" />
			 </a>
		    </p>
	    </li>
	</ul>
	</div>
</c:forEach>